package s14.ch17.ex1;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;

public class MyServer {

	public static void main(String[] args) throws IOException {
		ServerSocket ss = new ServerSocket(1234);

		Socket server = ss.accept();
		BufferedReader br = new BufferedReader(new InputStreamReader(server.getInputStream()));
		PrintWriter pw = new PrintWriter(server.getOutputStream(), true);

		String message = br.readLine();
		pw.println("Hello " + message);
		message = br.readLine();
		pw.println("Hello " + message);
		
		server.close();
	}

}
